<%@ include file="/layout/taglibs.jsp"%>

<jsp:useBean id="eventosMBean" scope="page" class="br.unicamp.ic.inf300.arena.action.vendas.EventosEmCartazManagerBean" />

<table class="display">
	<tr>
		<th><stripes:label for="espetaculo" /></th>
		<th><stripes:label for="data" /></th>
		<th><stripes:label for="horario" /></th>
		<th><stripes:label for="valor" /></th>
		<th><stripes:label for="unidadeNegocio" /></th>
		<th><stripes:label for="vagas" /></th>
	</tr>
	<c:choose>
		<c:when test="${empty eventosMBean.listaEventos}">
		  <tr class="even"">
		  	<td colspan="6">N&atilde;o h&aacute; eventos no momento!</td>
		  </tr>
		</c:when>
		<c:otherwise>
		  <c:forEach items="${eventosMBean.listaEventos}" var="evento" varStatus="current_row">
		  <tr class="${current_row.count mod 2 == 0 ? "even" : "odd"}">
			<td>

			 <stripes:link href="/acesso/Acessar.action" event="popularEventoSelecionado">
			  	${evento.espetaculo.titulo}
			  	<stripes:param name="codigo" value="${evento.codEvento}" />
			 </stripes:link>
			</td>

			<td><fmt:formatDate value="${evento.data}" dateStyle="medium" /></td>

			<td>${evento.horarioSessao}</td>

			<td>${evento.valor}</td>

			<td>${evento.sala.unidadeNegocio.endereco}</td>

			<td>${evento.qtdVagasLivre}</td>
		  </tr>
		  </c:forEach>
		</c:otherwise>
	</c:choose>
</table>